home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / laptop-mode-tools / modules / battery-level-polling < prev    next >
Encoding:
Text File  |  2012-05-20  |  893 b   |  31 lines

  1. #! /bin/sh
  2. # Laptop mode tools module: Battery level polling.
  3. #
  4.  
  5. if [ x$ENABLE_BATTERY_LEVEL_POLLING = x1 ] ; then
  6.     log "VERBOSE" "Battery level polling is enabled."
  7.  
  8.     if [ x$BLACKLIST_IN_FLOCK = x1 ]; then
  9.         log "VERBOSE" "Battery polling daemon blacklisted in flock"
  10.     else
  11.         if [ x$ON_AC = x1 ] ; then
  12.             log "VERBOSE" "On AC, stopping the polling daemon."
  13.  
  14.             # In AC mode we disable the polling daemon.
  15.             killall -q lm-polling-daemon
  16.         else
  17.             if ! pidof -x lm-polling-daemon ; then
  18.                 log "VERBOSE" "On battery and there was no polling daemon yet, starting the polling daemon."
  19.             
  20.                 # If there is no polling daemon, we start one.
  21.                 #/usr/share/laptop-mode-tools/module-helpers/lm-polling-daemon < /dev/null > /dev/null 2> /dev/null &
  22.                 /usr/share/laptop-mode-tools/module-helpers/lm-polling-daemon &
  23.             fi
  24.         fi
  25.     fi
  26. else
  27.     log "VERBOSE" "Battery level polling is disabled."
  28. fi
  29.  
  30.